package com.sun.entity;

import javax.persistence.Id;
import javax.persistence.Table;

import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

@Data
@Table(name = "user")
public class User {
	// 确保主键配置正确 不能使用int类型，int类型默认值为0，所有无法识别为主键 ，Integer为包装类默认值是null，mybatis会识别出来其没有赋值

	/*啊实打实*/
	@Id
	@KeySql(useGeneratedKeys = true)
	private Long id;
	private String name;
	private Integer age;
	private String sex;
	private String password;
	private String avatar;
}